﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TychoTest.Evaluation {
    [TestClass]
    public class TestRealArithmetic {
        [TestMethod]
        public void TestPlus () {
            Script.Test (
@"1.1 + 2.2",

@"> 3.3");
        }

        [TestMethod]
        public void TestMinus () {
            Script.Test (
@"2.2 - 1.1",

@"> 1.1");
        }

        [TestMethod]
        public void TestMultiply () {
            Script.Test (
@"2.5 * 3.9",

@"> 9.75");
        }

        [TestMethod]
        public void TestDivide () {
            Script.Test (
@"8.1 / 2.5",

@"> 3.24");
        }
        
        [TestMethod]
        public void TestPlusInteger () {
            Script.Test (
@"1.1 + 2",

@"> 3.1");
        }
        
        [TestMethod]
        public void TestMinusInteger () {
            Script.Test (
@"5.5 - 3",

@"> 2.5");
        }
        
        [TestMethod]
        public void TestMultiplyInteger () {
            Script.Test (
@"5.4 * 2",

@"> 10.8");
        }
        
        [TestMethod]
        public void TestDivideInteger () {
            Script.Test (
@"3.3 / 3",

@"> 1.1");
        }

        [TestMethod]
        public void TestLessThan () {
            Script.Test (
@"5.6 < 7.2",

@"> true");
        }

        [TestMethod]
        public void TestLessThanInteger () {
            Script.Test (
@"5.6 < 7",

@"> true");
        }
        
        [TestMethod]
        public void TestLessThanOrEqualTo () {
            Script.Test (
@"5.6 <= 5.6",

@"> true");
        }

        [TestMethod]
        public void TestGreaterThan () {
            Script.Test (
@"4.3 > 2.3",

@"> true");
        }

        [TestMethod]
        public void TestGreaterThanInteger () {
            Script.Test (
@"4.3 > 2",

@"> true");
        }
        
        [TestMethod]
        public void TestGreaterThanOrEqualTo () {
            Script.Test (
@"4.3 >= 4.3",

@"> true");
        }
        
        [TestMethod]
        public void TestToPower () {
            Script.Test (
@"3.1 ^ 4.5",

@"> 162.602651148962");
        }
        
        [TestMethod]
        public void TestToPowerInteger () {
            Script.Test (
@"3.4 ^ 2",

@"> 11.56");
        }

    }
}
